package com.fwh.gmall.base;

import lombok.Data;

@Data
public class ApiResponse {
    private Integer code;
    private String msg;
    private Object result;
    public ApiResponse(Integer code, String msg, Object result) {
        this.code = code;
        this.msg = msg;
        this.result = result;
    }

    public static ApiResponse success(Object result) {
        return new ApiResponse(200, "success", result);
    }

    public static ApiResponse error(Integer code, String msg) {
        return new ApiResponse(code, msg, null);
    }
}
